import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
import Print from 'vue-print-nb'
Vue.use(Print)
import '@/icons' // icon
import '@/permission' // permission control
// 通过*引入全部暴露出的对象，通过Object.keys方法获取键名组成的数组，然后将他们全部注册到vue实例上
import * as directives from '@/directives'
Object.keys(directives).forEach(key => {
  Vue.directive(key, directives[key])
})
// 自己封装的组件全局注册

import Component from '@/components'
Vue.use(Component) // 注册自己的插件
// 设置element为当前的语言
import i18n from '@/lang'
// Vue.use(ElementUI, {
//   i18n: (key, value) => i18n.t(key, value)
// })
Vue.use(ElementUI)
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
